package com.thread.n6;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.IntUnaryOperator;

public class TestAtomicInteger {
    public static void main(String[] args) {
        AtomicInteger atomicInteger=new AtomicInteger(0);
        System.out.println(atomicInteger.incrementAndGet());//++i
        System.out.println(atomicInteger.getAndIncrement());//i++
        System.out.println(atomicInteger.decrementAndGet());//--i]
        int i = atomicInteger.updateAndGet(x->x+10);
        System.out.println(i);

    }
}